<template>
	<view style="background: #fff;">
		<u-sticky style="background:#fff;">
			<view class="register_txt dis-flex flex-y-center" style="background: #fff;padding-top: 80rpx;">
				<image class="imgicon" src="/static/imgs/more.png" mode="widthFix" @click="() => show = true" />
				<view class="u_tabs flex-box">
					<u-tabs lineColor="#252525" :activeStyle="{ color: '#252525', fontWeight: '600' }" :list="tabsList"
						@click="tabClick" :current="current">
					</u-tabs>
				</view>
				<image class="imgicon" src="/static/imgs/search.png" mode="widthFix"
					@click="toJump('/pages/hall/search')" />
			</view>
			<u-tabs v-if="current === 2" lineColor="#252525" lineWidth="0"
				:activeStyle="{ color: '#252525', fontWeight: '600' }" :list="tabTwoList" @click="tabTwoClick"
				:current="currentTwo">
			</u-tabs>
		</u-sticky>
		<view class="main_box" v-if="currentTwo !== 1">
			<WaterFall v-if="showList" :type="type" :search="search"></WaterFall>
		</view>
		<view class="main_box" v-if="currentTwo == 1">
			<VowList v-if="showList" :search="search"></VowList>
		</view>
		<!-- 左侧弹窗 -->
		<u-popup :show="show" mode="left" @close="() => show = false">
			<view class="menus">
				<view class="items" v-for="item in menus" @click="Anoath(item.id)" :key="item.id">{{ item.name }}</view>
			</view>
		</u-popup>
		<Tabbar path="/pages/hall/list" />
	</view>
</template>

<script>
import WaterFall from '@/components/waterfall/waterfall'
import VowList from '@/components/waterfall/vowList'
export default {
	name: 'hallList', // 大厅
	components: {
		WaterFall,
		VowList
	},
	data() {
		return {
			current: 0,
			currentTwo: 0,
			show: false,
			menus: [{
				name: '绑定介绍',
				id: 1
			}, {
				name: '宣文介绍',
				id: 2
			}],
			tabsList: [{
				name: '关注'
			}, {
				name: '分享'
			}, {
				name: '永久'
			}],
			tabTwoList: [{
				name: '永久大厅'
			}, {
				name: '誓言大厅'
			}],
			list: [],
			type: 1,
			redata: 1,
			showList: true,
			search: '',
		}
	},
	mounted() {
		console.log(this.radata, '--------------------1');
		this.radata += 1
	},
	onShow() {
		// this.search = this.$store.state.searchData;
		// console.log(this.search,'加入搜索');
		this.showList = true
		uni.hideTabBar()
	},
	onHide() {
		this.showList = false
	},
	methods: {

		Anoath(id) {
			console.log(id)
			if (id == 1) {
				uni.navigateTo({
					url: "/pages/login/agreement?type=binding"
				})
			} else {
				uni.navigateTo({
					url: "/pages/login/agreement?type=announcement"
				})
			}
		},
		tabClick(e) {
			console.log(e, '切换')
			if (e.index == 0) {
				this.type = 1
			}
			if (e.index == 1) {
				this.type = 2
			}
			if (e.index == 2) {
				this.type = 3
			}
			this.current = e.index
			this.currentTwo = 0
		},
		tabTwoClick(e) {
			this.currentTwo = e.index
		},
		toJump(url) {

			if (!url) return
			uni.navigateTo({
				url
			});
		},
	}
}
</script>

<style lang="scss" scoped>
.register_txt {
	padding: 0 24rpx;

	.imgicon {
		width: 46rpx;
	}

	/deep/.u-tabs__wrapper__nav__item {
		flex: 1;
	}
}

.menus {
	padding: 60rpx 100rpx 30rpx;

	.items {
		font-size: 30rpx;
		color: $uni-text-color;
		line-height: 90rpx;
	}
}

// .main_box {
// 	margin-top: 88rpx;
// }</style>